package com.swak.consistency.core.invoke;

import com.swak.consistency.core.aspect.ConsistencyProceeding;

/**
 * 代码片段执行器
 * 
 * @author DELL
 */
public interface Invoker {

	/**
	 * 创建执行片段
	 * 
	 * @param proceeding
	 * @param targetMethod
	 * @return
	 */
	Invocation createInvocation(ConsistencyProceeding proceeding, String targetMethod);

	/**
	 * 执行代码片段
	 * 
	 * @param invocation
	 * @return
	 * @throws Exception
	 */
	Object invokeInvocation(Invocation invocation) throws Exception;
}
